package com.atguigu.utils

/**
  *
  * @author Lec
  * @date 2022/7/15 22:12
  */
import java.io.InputStreamReader
import java.util.Properties

object PropertiesUtil {

  def load(propertieName:String): Properties ={
    val prop=new Properties()
    prop.load(new InputStreamReader(Thread.currentThread().getContextClassLoader.getResourceAsStream(propertieName) , "UTF-8"))
    prop
  }

  //测试该方法
//  def main(args: Array[String]): Unit = {
//    val properties: Properties = load("config.properties")
//    println(properties.getProperty("kafka.broker.list"))
//  }
}

